package de.tum.in.eist.poll.shared.beans;

import java.io.Serializable;

/**
 * A Feedback is a group of answers belonging to one Lecture.
 * This group of answers is given by one Student. 
 * 
 * @author The EIST-POLL-21 team.
 *
 */
public class Feedback implements Serializable {
	/**
	 * serialization version 
	 */
	private static final long serialVersionUID = 1L;
	
	private String studentID;
	private String lectureID;
	private Answer[] answers;

	/**
	 * Dummy constructor for GWT. Never ever use this.
	 */
	public Feedback() {
		this(new Student().getUserID(), new Lecture().getLectureID(), new Answer[]{});
	}
	
	/**
	 * Construct a Feedback with Answers for a Lecture, given by a Student.
	 * 
	 * @param studentID The ID of the Student this Feedback originates from.
	 * @param lectureUD The ID of the Lecture this Feedback is addressed to.
	 * @param answers The Answers given by the Student.
	 */
	public Feedback(String studentID, String lectureID, Answer[] answers) {
		this.studentID = studentID;
		this.lectureID = lectureID;
		this.answers = answers;
	}

	/**
	 * 
	 * @return The Student's user ID.
	 */
	public String getStudentID() {
		return studentID;
	}

	/**
	 * 
	 * @return The lecture's ID.
	 */
	public String getLectureID() {
		return lectureID;
	}
	
	/**
	 * 
	 * @return The group of answers.
	 */
	public Answer[] getAnswers() {
		return answers;
	}
	
	/**
	 * This method replaces the current group of answers
	 * with the given one.
	 * 
	 * @param answers The new group of answers.
	 */
	public void setAnswers(Answer[] answers) {
		this.answers = answers;
	}
}
